<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
    <div class="col-lg-12">
        <div class="btn-group mb-3">
            <!--{hook plugin_zls_sitemap_admin_tab.php}-->
        </div>
        <div class="card">
            <div class="card-body">
                <form action="<?php echo url('plugin-setting-zls_sitemap-set');?>" method="post" id="form">
                    <div class="form-group row">
                        <label class="col-sm-2 form-control-label">URL前缀：</label>
                        <div class="col-sm-10">
                            <?php echo $input['domain']; ?>
                            <div class="figure-caption mt-2">如果填写，则末尾需要带"/"，例：<span class="text-info">http://www.baidu.com/</span></div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 form-control-label">单个xml最大网址数：</label>
                        <div class="col-sm-10">
                            <?php echo $input['maxsize']; ?>
                            <div class="figure-caption mt-2">每个xml文件最多可包含<span class="text-info">50,000</span>个网址</div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 form-control-label"></label>
                        <div class="col-sm-10">
                            <button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
                            <a role="button" class="btn btn-secondary btn-block mt-3" href="javascript:history.back();">
                                <?php echo lang('back');?>
                            </a>
                        </div>
                    </div>
                </form>
                <div class="row">
                    <div class="col-sm-2">注:&nbsp;</div>
                    <div class="col-sm-10">
                        <ul class="list-unstyled">
                            <li>文本框清空后提交表单，该项设置就可以回归默认值。</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
    var jform = $("#form");
    var jsubmit = $("#submit");
    jform.on('submit', function () {
        jform.reset();
        jsubmit.button('loading');
        var postdata = jform.serialize();
        $.xpost(jform.attr('action'), postdata, function (code, message) {
            if (code === 0) {
                $.alert(message);
                jsubmit.text(message).delay(2000).button('reset').location();
            } else {
                $.alert(message);
                jsubmit.button('reset');
            }
        });
        return false;
    });
</script>